package com.health.api.fallback;


import com.health.api.client.MedicineClient;
import com.health.api.model.producer.ProducerRegisterRequest;
import com.health.api.model.transporter.TransporterRegisterRequest;
import com.health.common.model.vo.UserKeyVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;


/**
 * @author zhexueqi
 * @ClassName ItemClientFallback
 * @since 2024/5/14    21:35
 */
@Slf4j
public class MedicineClientFallback implements FallbackFactory<MedicineClient> {
    @Override
    public MedicineClient create(Throwable cause) {
        return new MedicineClient() {

            @Override
            public String getManufacturerByUserId() {
                return "";
            }

            @Override
            public Boolean createManufacturerToMysql(ProducerRegisterRequest producerRegisterRequest) {
                log.error("createManufacturerToMysql fallback");
                return false;
            }

            @Override
            public boolean createManufacturer(UserKeyVO userKeyVO, String userAccount) {
                log.error("createManufacturer fallback");
                return false;
            }

            @Override
            public String getTransportByUserId() {
                return "";
            }

            @Override
            public Boolean createTransporterToMysql(TransporterRegisterRequest transporterRegisterRequest) {
                log.error("createTransporterToMysql fallback");
                return false;
            }

            @Override
            public void createTransporter(UserKeyVO userKeyVO, String userAccount) {
                log.error("createTransporter fallback");
            }
        };
    }
}
